package design.p16_iterator;

/**
 * @ClassName: Java
 * @description:
 * @author: zxf
 * @create: 2021-06-19 12:53
 **/
public class MyCollection implements Collection{

    public String[] string = {"A","b","c","d"};

    @Override
    public Iterator iterator() {
        return new MyIterator(this);
    }

    @Override
    public Object get(int i) {
        return string[i];
    }

    @Override
    public int size() {
        return string.length;
    }
}

